<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-5 col-sm-2">{:__('Delivertime')}:</label>
        <div class="col-xs-5 col-sm-3">
            <input id="c-delivertime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[delivertime]" type="text" value="{:date('Y-m-d')}">
        </div>
        <label class="control-label col-xs-5 col-sm-2">{:__('Factory_id')}:</label>
        <div class="col-xs-5 col-sm-3">
            <input id="c-factory_id" data-rule="required" data-source="clothbank/index" data-params={"custom[sort]":"1"} class="form-control selectpage" name="row[factory_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Attachment')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[attachment]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    
    <div class="form-group">
    	<label class="control-label col-xs-12 col-sm-2">{:__('裁床单')}:</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table fieldlist" data-template="billtpl" data-name="row[bill]" id="second-table">
                <tr>
                    <td>{:__('裁床单号')}</td>
                    <td>{:__('款号')}</td>
                    <td>{:__('数量')}</td>
                    <td>加工费</td>
                    <td>备注</td>
                    <td>操作</td>
                </tr>
                <tr>
                    <td colspan="4"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>

            <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
            <textarea name="row[bill]" class="form-control" cols="30" rows="5" style="display: none;">[{}]</textarea>
            <script id="billtpl" type="text/html">
               <tr class="form-inline">
                 <td><input type="text" name="<%=name%>[<%=index%>][cutbill_id]" class="form-control selectpage" data-source="cutbill/produce" data-params={"custom[status]":"1"} data-field="sn" placeholder="裁床单号"/></td>
                 <td><input type="text" name="<%=name%>[<%=index%>][clothtype_id]" class="form-control selectpage" data-source="clothtype/index" data-field="sn" placeholder="款号"/></td>
                 <td><input type="int" name="<%=name%>[<%=index%>][goods_nums]" class="form-control" style="width:100px" placeholder="数量"/></td>
				 <td><input type="int" name="<%=name%>[<%=index%>][process_fee]" class="form-control" style="width:100px" placeholder="加工费"/></td>
				 <td><input type="text" name="<%=name%>[<%=index%>][remark]" class="form-control" style="width:200px" placeholder="备注"/></td>
                 <td>
                    <!--下面的两个按钮务必保留-->
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                 </td>
			  </tr>
            </script>
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Remarck')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remarck" class="form-control " rows="5" name="row[remarck]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
